package com.briup.estore.controller;

import java.util.Arrays;
import java.util.Map;

import com.briup.estore.common.utils.PageUtils;
import com.briup.estore.common.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.briup.estore.entity.RecommendShopEntity;
import com.briup.estore.service.RecommendShopService;


/**
 * 
 *
 * @author adam
 * @email xueyz@briup.com
 * @date 2023-03-30 14:35:49
 */
@RestController
@RequestMapping("estore/recommendshop")
public class RecommendShopController {
    @Autowired
    private RecommendShopService recommendShopService;




    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
		RecommendShopEntity recommendShop = recommendShopService.getById(id);

        return R.ok().put("recommendShop", recommendShop);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody RecommendShopEntity recommendShop){
		recommendShopService.save(recommendShop);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody RecommendShopEntity recommendShop){
		recommendShopService.updateById(recommendShop);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
		recommendShopService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
